package com.example.myactspringboot.listener;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.HashMap;

/**
 * @Author Zhouchb
 * @Create 2023-10-27 22:04
 * @Description
 */
@Component("applyTaskListener")
@Slf4j
public class ApplyTaskListener implements ExecutionListener {

    @Override
    public void notify(DelegateExecution delegateExecution) {
        System.out.println("执行了ExecutionListener");
        HashMap<String, Object> map = new HashMap<>();
        map.put("reject", 0);//拒绝人数
        map.put("agree", 0);//同意人数
        delegateExecution.setVariables(map);
    }
}
